package com.example.chat.session.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;


import java.time.LocalDateTime;

@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper=false)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("scs_session")
public class SessionEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    public static final String ID = "id";
    public static final String TYPE = "type";
    public static final String VISITOR_ID = "visitor_id";
    public static final String RECEPTIONIST_ID = "receptionist_id";
    public static final String STATUS = "status";
    public static final String SOURCE = "source";
    public static final String CREATE_TIME = "create_time";
    public static final String UPDATE_TIME = "update_time";
    public static final String IS_DELETED = "is_deleted";

    /** 主键 */
    @TableId(type = IdType.ASSIGN_ID)
    @TableField(value = ID)
    private Long id;

    /** 会话类型：1-当前会话，2-历史会话 */
    @TableField(value = TYPE)
    private Integer type;

    /** 访客ID */
    @TableField(value = VISITOR_ID)
    private Long visitorId;

    /** 接待坐席ID */
    @TableField(value = RECEPTIONIST_ID)
    private Long receptionistId;

    /** 会话状态：0-未激活，1-激活 */
    @TableField(value = STATUS)
    private Integer status;

    /** 来源 */
    @TableField(value = SOURCE)
    private Integer source;

    /** 创建时间 */
    @TableField(value = CREATE_TIME, fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /** 更新时间 */
    @TableField(value = UPDATE_TIME, fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    /** 是否软删：0-否，1-是 */
    @TableField(value = IS_DELETED)
    private Integer isDeleted;


}
